<template>
  <div>
    <div class="title">
      <span class="title1">Q-Factory Portal</span>
    </div>
    <el-table :data="tableData" style="width: 100%" :header-cell-style="headerStyleEvent">
      <!-- <el-table-column prop="lineId" label="LineId" width="160" align="center"></el-table-column>
      <el-table-column prop="lineName" label="LineName" width align="center"></el-table-column>
      <el-table-column prop="machineId" label="设备ID" align="center"></el-table-column>
      <el-table-column prop="machineName" label="设备型号" align="center"></el-table-column>-->
      <el-table-column prop="errorCode" label="ErrorCode" align="center"></el-table-column>
      <el-table-column prop="errorCnt" label="errorCount" align="center"></el-table-column>
      <el-table-column prop="errorTotalTime" label="errorTotalTime" align="center"></el-table-column>
    </el-table>
  </div>
</template>
<script>
import dayjs from "dayjs";
import { getMachineIssue } from '@/network/nxt'
export default {
  name: 'issue',
  props: {

  },
  components: {},
  data() {
    return {
      tableData: [],
      MachineId: '',
      top: '',
    }
  },
  mounted() {
    this.getTableData()
  },
  methods: {
    async getTableData() {
      try {
        const startDateTime = dayjs().format('YYYY-MM-DD 08:00:00')
        const endDateTime = dayjs().format('YYYY-MM-DD HH:mm:ss')
        const res = await getMachineIssue({ startDateTime, endDateTime, MachineId: this.MachineId, top: this.top })
        console.log(res);
        this.tableData = res.data.isssueInfo
      } catch (error) {
        console.log(error);
      }
    },
    headerStyleEvent() {
      return { background: '#eef1f6', color: '#606266' }
    },
  }
}
</script>
<style scoped>
.title {
  background-color: #0060b5;
  /* height: 70px; */
  font-size: 23px;
  line-height: 40px;
  color: white;
}
.title1 {
  margin-left: 80px;
}
</style>